﻿//请在场景中创建 100000 个随机位置 的立方体,让其不会明显卡顿
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Lesson14_code2 : MonoBehaviour
{
    IEnumerator MyCoroutine()
    {
        for (int i=0; i<10; i++)
        {
            for (int j=0; j<1000; j++)
            {
                GameObject obj = GameObject.CreatePrimitive(PrimitiveType.Cube);
                obj.transform.position = new Vector3(Random.Range(-100, 100), Random.Range(-100, 100), Random.Range(-100, 100));
            }
            yield return new WaitForSeconds(1f);
        }
    }

    void Start()
    {
        StartCoroutine(MyCoroutine());
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
